import { createRouter, createWebHistory } from 'vue-router';

const router = createRouter({
  history: createWebHistory(),
  routes: [
    {
      path: '/',
      redirect: '/monitor',
    },
    {
      path: '/monitor',
      name: 'MonitorDashboard',
      component: () => import('../views/admin/index.vue'),
      meta: {
        title: '系统监控',
        keepAlive: true,
      },
    },
    {
      path: '/monitor/cache',
      name: 'CacheMonitor',
      component: () => import('../views/cache/index.vue'),
      meta: {
        title: '缓存监控',
        keepAlive: true,
      },
    },
    {
      path: '/monitor/logininfor',
      name: 'LoginInfoMonitor',
      component: () => import('../views/logininfor/index.vue'),
      meta: {
        title: '登录日志',
        keepAlive: true,
      },
    },
    {
      path: '/monitor/online',
      name: 'OnlineMonitor',
      component: () => import('../views/online/index.vue'),
      meta: {
        title: '在线用户',
        keepAlive: true,
      },
    },
    {
      path: '/monitor/operlog',
      name: 'OperLogMonitor',
      component: () => import('../views/operlog/index.vue'),
      meta: {
        title: '操作日志',
        keepAlive: true,
      },
    },
    {
      path: '/monitor/snailjob',
      name: 'SnailJobMonitor',
      component: () => import('../views/snailjob/index.vue'),
      meta: {
        title: '定时任务',
        keepAlive: true,
      },
    },
    {
      path: '/monitor/:pathMatch(.*)*',
      name: 'MonitorNotFound',
      component: () => import('../views/NotFound.vue'),
    },
  ],
});

export default router;
